home *** CD-ROM | disk | FTP | other *** search
- Path: easy.in-chemnitz.de!mkmk!floh
- From: floh@mkmk.in-chemnitz.de (Andre Weissflog)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Multiplatform Development
- Message-ID: <Qqi1y*3F0@mkmk.in-chemnitz.de>
- Date: Fri, 02 Feb 1996 01:15:32 CET
- Reply-To: floh@mkmk.in-chemnitz.de
- References: <4eqr9u$s25@sundog.tiac.net>
- Distribution: world
- Organization: private uucp site
- X-Newsreader: Arn V 1.04
-
- In article <4eqr9u$s25@sundog.tiac.net>, Darius Taghavy writes:
-
- > Does anyone have experience with multiplatform application development?
- > I currently have a large Amiga app (not yet released) that I am
- > considering to port to one or more of Mac/Be/NT/OS2.
- >
- > I will keep developing on and for the Amiga, but real life economics
- > require me to consider some of these other platforms.
- >
- > Main questions:
- >
- > a) Graphics
- > what is the graphics API like in these other systems?
- > I.e. On the Amiga we use Move(), Draw(),RectFill(),Text() etc.
- > all of which use a struct RastPort * as first argument.
- > I have already abstracted this layer. For example, I have
- > a text display routine that gets (rastport pointer, x,y, text
- > pointer) arguments.
- > Do these other API's also use a single handle, such as RastPort?
- >
- > Mac: ?
- > NT: ?
- > OS2: ?
- > Be: ?
- >
- The graphics APIs should be very different, but there should always
- be an actual "graphics context" like a RastPort on the Amiga,
- and a set of functions that work on it (on the Be, you will
- have C++ objects for that).
-
- It may be worth it to write stub functions that have the
- same interface as their Amiga counterparts, but translate
- the call to the specific OS environment. I have done this
- for a subset of iffparse.library functions on the PC,
- it works pretty well. The problem with this approach is that
- you are basically reinventing the wheel, and the new wheel
- will never be as good as the existing one, since you
- only have a black box to start from.
-
- The other approach would be to write a system indepent
- library of primitive functions, and use only those functions
- in your higher level application code. Then rewrite the library
- for every new platform.
-
- > b) Event Handling
-
- Can't really serve with this one.
-
- >
- > c) Interrupts/Timers
- > My app uses multiple tasks and interrupts. For a non-multi-tasking
- > OS I could still work, as I can conditionally compile into a
- > single task/multiple interrupt model already.
- > Basically, what I need is:
- > - *hardware* timer interrupt
- ^^^^^^^^^^^^^^^^^^^^^^^^^^
- That's a problem on PCs under (at least) MS-DOS. You only
- have the system clock running at 18.2Hz. If you want better
- resolution, you'll have to hit the hardware directly and
- install your own timer interrupt server. Nasty...
-
- > - serial interrupt when receive buffer is full
- > - serial interrupt when transmit buffer is full
- >
- Sorry, no idea.
-
- > d) CPU/Memory Architecture
- > I love architectures that are based on a linear address
- > space using the 68K family. I use a lot of pointers and
- > have no intention to ever code for a 16 bit OS.
- > I have heard horror stories about Intel processors and
- > have been fortunate to never having had to code for one.
-
- Should be no problem under OS/2, or even Win3.1 386. The
- only thing is, you must run in protected mode with
- flat memory model, "modern" OS's do this all the time, for
- DOS-apps you'll need a DOS extender. It's really not that
- horrifying, with Watcom C for instance, you just say
- something like "link as 32bit DOS application running under
- DOS4GW", and the compiler will do the rest for you, selecting
- the right link libraries etc. You can malloc() memory blocks
- as big as you want them, and pointer arithmetics works
- just fine, like on real computers. Assembly coding
- is actually easier in flat memory model, since you don't
- need to mess around with segment registers.
-
- It only gets tricky if you want to access exotic BIOS functions,
- or (just for example) want to use VESA2.0 calls. But that's
- all MS-DOS babble...
-
- > Does NT abstract this somehow? Can you just declare
- > long *whatever; and then reference is the same way as on
- > the ami? Or do you have to deal with memory banks etc and
-
- Yes, should work on all systems except MS-DOS without
- DOS-extender. Just define your pointers, and fool around
- with them.
-
- > contruct a pointer from that. If I had to call a function
- > for every pointer I need it would be too slow and I wouldn't
- > even consider such a rediclious environment.
- >
- No problem in protected mode, technically you'll still
- have segments, but only one for each code, data and stack, and at
- least code and data start both at address 0 and go linearly up to
- 4GB. Pointers are always 32 bit.
-
- > e) Source Code Database
- > How do you actually compile for the different targets?
- > Since there are no multiplatform compilers on the Amiga
- > such as the ones I looked at on Windows/OS2/Mac, how do
- > you maintain a single code base? (I do not like "cut and
- > paste" development).
- >
- Can be tricky to avoid. First, there's #ifdef, but of
- course the code will soon be unreadable if there are
- too many of them. I use a central "sys.h" header, where
- I try to encapsulate some system specific things into
- macros.
-
- > What comes to mind is to network the Amiga with the other
- > machine(s), then run the compiler on the other machine,
- > accessing the files stored on an Amiga filesystem and store
- > the object code in separate subdirs (one for each target).
- >
- This should work.
- Currently I have wired the PC via serial line to my Amiga
- and transfer all changes on the sources to the PC, which
- is only used for compiling and some debugging. The ultimate
- goal for me is to have only one source base, and either cross
- compile, or compile over a NFS link.
-
- > There are other issues. I just typed up the ones that came to
- > mind immediately. But this should be enough to get a discussion
- > started. A public discussion for the benefit of everyone would be
- > great, but if you like to help and stay anonymous for whatever
- > reason, I would appreciate private e-mail, even if it's just a
- > short hint or two.
-
- Hope it helped,
- -Floh.
-
- ====//=== Andre Weissflog <floh@mkmk.in-chemnitz.de> =======
- ...// Sep'95: Return Of The Living Death...................
- \\// 90% of everything is crap (Sturgeon's Law)...........
- =\\===============================================Amiga!=
-
-